import { createRouter, createWebHashHistory, RouteRecordRaw } from 'vue-router'
import Layout from '../views/home/Layout.vue';
import GoodsDetail from '../views/goodsDetail/index.vue';

const routes: Array<RouteRecordRaw> = [
  {path:"/",redirect:"/home"},
  {path:"/home",component:Layout,redirect:"/home/goods",children:[
    {path:"goods",component:()=>import("../views/home/Goods.vue")},
    {path:"shop",component:()=>import("../views/home/Shop.vue")},
    {path:"Ratings",component:()=>import("../views/home/Ratings.vue")},
  ]},
  {path:"/goodsdetail",component:GoodsDetail}
]

const router = createRouter({
  history: createWebHashHistory(),
  routes
})

export default router
